package com.example.autumn.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * @author Liaorun
 */
@LocalTCC
public interface IAccountTccService {

    @TwoPhaseBusinessAction(name = "deduct", commitMethod = "commit", rollbackMethod = "cancel")
    void deduct(@BusinessActionContextParameter String userId, @BusinessActionContextParameter int money);


    boolean commit(BusinessActionContext context);

    boolean cancel(BusinessActionContext context);

}
